package it.polimi.swimv2.entities;

import it.polimi.swimv2.util.StringCapitalizer;

import java.io.Serializable;
import java.lang.Integer;
import java.lang.String;
import javax.persistence.*;

/**
 * Entity implementation class for Entity: Suggestion. Represents a suggestion
 * sent to the administrator containing a new ability,that could be added to the
 * declarable abilities in swimv2.
 */
@Entity
@Table(name = "Suggestion")
public class Suggestion implements Serializable {

	@Id
	@GeneratedValue
	@Column(name = "id", nullable = false)
	private Integer id;
	@Column(name = "newAbility", nullable = false)
	private String newAbility;
	@ManyToOne
	private User sender;

	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	public Suggestion() {
		super();
	}

	/**
	 * 
	 * @return
	 */
	public Integer getId() {
		return this.id;
	}

	/**
	 * 
	 * @param id
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * 
	 * @return
	 */
	public String getNewAbility() {
		return this.newAbility;
	}

	/**
	 * 
	 * @param newAbility
	 */
	public void setNewAbility(String newAbility) {
		this.newAbility = StringCapitalizer.capitalize(newAbility);
	}

	/**
	 * 
	 * @return
	 */
	public User getSender() {
		return this.sender;
	}

	/**
	 * 
	 * @param sender
	 */
	public void setSender(User sender) {
		this.sender = sender;
	}

	@Override
	public String toString() {
		return "Suggestion [id=" + id + ", newAbility=" + newAbility
				+ ", sender=" + sender + "]";
	}
}
